<HTML><FONT FACE=Arial, Verdana, Sans><TITLE>MarketEnvironment.agent</TITLE><BODY><STYLE TYPE="text/css"><!--.centeralign <BLOCKQUOTE>text-align:center</BLOCKQUOTE>--></STYLE><HEAD><P CLASS="centeralign">MarketEnvironment.agent</P></HEAD><IMG SRC=images/tlabsqosmodell.MarketEnvironment.png border=1 alt="Flowchart for MarketEnvironment.agent" title="Flowchart for MarketEnvironment.agent"></P>The package name is "tlabsqosmodell".</p>
The following external code is referenced:<BLOCKQUOTE></p>
<li>Components from java.io.*</li></p>
<li>Components from java.math.*</li></p>
<li>Components from java.util.*</li></p>
<li>Components from javax.measure.unit.*</li></p>
<li>Components from org.jscience.mathematics.number.*</li></p>
<li>Components from org.jscience.mathematics.vector.*</li></p>
<li>Components from org.jscience.physics.amount.*</li></p>
<li>Components from repast.simphony.adaptation.neural.*</li></p>
<li>Components from repast.simphony.adaptation.regression.*</li></p>
<li>Components from repast.simphony.context.*</li></p>
<li>Components from repast.simphony.context.space.continuous.*</li></p>
<li>Components from repast.simphony.context.space.gis.*</li></p>
<li>Components from repast.simphony.context.space.graph.*</li></p>
<li>Components from repast.simphony.context.space.grid.*</li></p>
<li>Components from repast.simphony.engine.environment.*</li></p>
<li>Components from repast.simphony.engine.schedule.*</li></p>
<li>Components from repast.simphony.engine.watcher.*</li></p>
<li>Components from repast.simphony.groovy.math.*</li></p>
<li>Components from repast.simphony.integration.*</li></p>
<li>Components from repast.simphony.matlab.link.*</li></p>
<li>Components from repast.simphony.query.*</li></p>
<li>Components from repast.simphony.query.space.continuous.*</li></p>
<li>Components from repast.simphony.query.space.gis.*</li></p>
<li>Components from repast.simphony.query.space.graph.*</li></p>
<li>Components from repast.simphony.query.space.grid.*</li></p>
<li>Components from repast.simphony.query.space.projection.*</li></p>
<li>Components from repast.simphony.parameter.*</li></p>
<li>Components from repast.simphony.random.*</li></p>
<li>Components from repast.simphony.space.continuous.*</li></p>
<li>Components from repast.simphony.space.gis.*</li></p>
<li>Components from repast.simphony.space.graph.*</li></p>
<li>Components from repast.simphony.space.grid.*</li></p>
<li>Components from repast.simphony.space.projection.*</li></p>
<li>Components from repast.simphony.ui.probe.*</li></p>
<li>Components from repast.simphony.util.*</li></p>
<li>Components from simphony.util.messages.*</li></p>
<li>Components from static java.lang.Math.*</li></p>
<li>Components from static repast.simphony.essentials.RepastEssentials.*</li></p>
<li>Components from repast.simphony.jung.tablemodels.*</li></p>
<li>Components from tlabsqosmodell.IndexPairs.*</li></p>
</BLOCKQUOTE><P></p>
The class "MarketEnvironment" is defined with visibility "public" . This is an agent.</p>
 <BLOCKQUOTE></p>
</p>
    <li>There is a field named "trafficDevelopment" with visibility "public" of type "float" and default value 1. This is an agent property. The block is tagged with the name "Traffic development".</li></p>
</p>
    <li>There is a field named "connected" with visibility "public" of type "boolean" and default value false. This is an agent property. The block is tagged with the name "Connected ?".</li></p>
</p>
    <li>There is a field named "possibleConnections" with visibility "public" of type "def List" and default value new ArrayList(). This is an agent property. The block is tagged with the name "List of possible connections".</li></p>
</p>
    <li>There is a field named "pConnections" with visibility "public" of type "def List" and default value new ArrayList(). This is an agent property. The block is tagged with the name "List of p connections".</li></p>
</p>
    <li>There is a field named "providerMethod" with visibility "public" of type "String" and default value "". This is an agent property. The block is tagged with the name "Provider Selection Method".</li></p>
</p>
    <li>There is a field named "typeOfNetwork" with visibility "public" of type "String" and default value "". This is an agent property. The block is tagged with the name "Type of the Network".</li></p>
</p>
    <li>There is a field named "transitConnections" with visibility "public" of type "def List" and default value new ArrayList(). This is an agent property. The block is tagged with the name "List of received Transit connections".</li></p>
</p>
    <li>There is a field named "qosConnections" with visibility "public" of type "def List" and default value new ArrayList(). This is an agent property. The block is tagged with the name "List of received QoS connections".</li></p>
</p>
    <li>There is a field named "peeringConnections" with visibility "public" of type "def List" and default value new ArrayList(). This is an agent property. The block is tagged with the name "List of received Peering connections".</li></p>
</p>
    <li>There is a field named "listOfBackbones" with visibility "public" of type "def List" and default value new ArrayList(). This is an agent property. The block is tagged with the name "List of Backbones".</li></p>
</p>
    <li>There is a field named "agentIsBackbone" with visibility "public" of type "boolean" and default value false. This is an agent property. The block is tagged with the name "Network is Backbone ?".</li></p>
</p>
    <li>There is a field named "publicCount" with visibility "public" of type "int" and default value 0. This is an agent property. The block is tagged with the name "public Count of PeeringPoints".</li></p>
</p>
    <li>There is a field named "privateCount" with visibility "public" of type "int" and default value 0. This is an agent property. The block is tagged with the name "private Count of PeeringPoints".</li></p>
</p>
    <li>There is a field named "popularity_BE" with visibility "public" of type "double" and default value 0. This is an agent property. The block is tagged with the name "BE content popularity".</li></p>
</p>
    <li>There is a field named "popularity_QoS" with visibility "public" of type "double" and default value 0. This is an agent property. The block is tagged with the name "QoS content popularity".</li></p>
</p>
    <li>There is a field named "privateCities" with visibility "public" of type "int" and default value 0. Count of Private Peering Point cities The block is tagged with the name "privateCities".</li></p>
</p>
    <li>There is a field named "publicCities" with visibility "public" of type "int" and default value 0. Count of Public Peering Point cities The block is tagged with the name "publicCities".</li></p>
</p>
    <li>There is a field named "geographicScope" with visibility "public" of type "String" and default value "Regional". This is an agent property. The block is tagged with the name "Geographic Scope".</li></p>
</p>
    <li>There is a field named "trafficRatio" with visibility "public" of type "String" and default value "undefined". This is an agent property. The block is tagged with the name "Traffic Ratio".</li></p>
</p>
    <li>There is a field named "networkType" with visibility "public" of type "String" and default value "". network Type of the Agent The block is tagged with the name "networkType".</li></p>
</p>
    <li>There is a field named "transitPriceMultiplier" with visibility "public" of type "double" and default value 0. This is an agent property. The block is tagged with the name "Transit Price Multiplier m".</li></p>
</p>
    <li>There is a field named "peeringMethod" with visibility "public" of type "String" and default value "". This is an agent property. The block is tagged with the name "Peering Selection Method".</li></p>
</p>
    <li>There is a field named "asn" with visibility "public" of type "int" and default value 0. This is an agent property. The block is tagged with the name "ASN".</li></p>
</p>
    <li>There is a field named "trafficLevel" with visibility "public" of type "String" and default value "undefined". This is an agent property. The block is tagged with the name "Traffic Level".</li></p>
</p>
    <li>There is a field named "qosDemand" with visibility "public" of type "double" and default value 0. This is an agent property. The block is tagged with the name "QoS Demand [% of the total Traffic Demand]".</li></p>
</p>
    <li>There is a field named "listOfPublicCities" with visibility "public" of type "def List" and default value new ArrayList(). This is an agent property. The block is tagged with the name "list of public Cities".</li></p>
</p>
    <li>There is a field named "posConnections" with visibility "public" of type "def List" and default value new ArrayList(). This is an agent property. The block is tagged with the name "consider city check and compute list possible Connections ".</li></p>
</p>
    <li>There is a field named "o_trafficQoS" with visibility "public" of type "def" and default value 0. This is an agent property. The block is tagged with the name "o_trafficQoS".</li></p>
</p>
    <li>There is a field named "removedAgentsBecauseOfPeering" with visibility "public" of type "def List" and default value new ArrayList(). This is an agent property. The block is tagged with the name "List of removed Agents because of received Peering connections".</li></p>
</p>
    <li>There is a field named "o_trafficBE" with visibility "public" of type "def" and default value 0. This is an agent property. The block is tagged with the name "o_trafficBE".</li></p>
</p>
    <li>There is a field named "similarityMap" with visibility "public" of type "def" and default value null. This is an agent property. The block is tagged with the name "Map with the SimilarityIndex".</li></p>
</p>
    <li>There is a field named "i_traffic" with visibility "public" of type "def" and default value 0. overall trafficInquire The block is tagged with the name "Overall Traffic Consumption".</li></p>
</p>
    <li>There is a field named "trafficConsumption" with visibility "public" of type "String" and default value "". This is an agent property. The block is tagged with the name "Total Traffic Consumption".</li></p>
</p>
    <li>There is a field named "i_traffic_BE" with visibility "public" of type "def" and default value 0. BE trafficInquire The block is tagged with the name "BE Traffic Consumption".</li></p>
</p>
    <li>There is a field named "i_traffic_QoS" with visibility "public" of type "def" and default value 0. QoS trafficInquire The block is tagged with the name "QoS Traffic Consumption".</li></p>
</p>
    <li>There is a field named "overallTraffic" with visibility "public" of type "double" and default value 0. This is an agent property. The block is tagged with the name "Overall Traffic".</li></p>
</p>
    <li>There is a field named "overallTraffic_BE" with visibility "public" of type "double" and default value 0. This is an agent property. The block is tagged with the name "Overall BE Traffic".</li></p>
</p>
    <li>There is a field named "overallTraffic_QoS" with visibility "public" of type "double" and default value 0. This is an agent property. The block is tagged with the name "Overall QoS Traffic".</li></p>
</p>
    <li>There is a field named "c_traffic" with visibility "public" of type "def" and default value 0. overall trafficCreation The block is tagged with the name "Overall Traffic Creation".</li></p>
</p>
    <li>There is a field named "c_traffic_BE" with visibility "public" of type "def" and default value 0. BE trafficCreation The block is tagged with the name "BE Traffic Creation".</li></p>
</p>
    <li>There is a field named "c_traffic_QoS" with visibility "public" of type "def" and default value 0. QoS trafficCreation The block is tagged with the name "QoS Traffic Creation".</li></p>
</p>
    <li>There is a field named "t_traffic" with visibility "public" of type "def" and default value 0. overall trafficTransit The block is tagged with the name "Overall Traffic Transit".</li></p>
</p>
    <li>There is a field named "t_traffic_BE" with visibility "public" of type "def" and default value 0. BE trafficTransit The block is tagged with the name "BE Traffic Transit".</li></p>
</p>
    <li>There is a field named "t_traffic_QoS" with visibility "public" of type "def" and default value 0. QoS trafficTransit The block is tagged with the name "QoS Traffic Transit".</li></p>
</p>
    <li>There is a field named "trafficConsumption_BE" with visibility "public" of type "double" and default value 0. This is an agent property. The block is tagged with the name "Total Traffic Consumption".</li></p>
</p>
    <li>There is a field named "trafficConsumption_QoS" with visibility "public" of type "double" and default value 0. This is an agent property. The block is tagged with the name "Total Traffic Consumption".</li></p>
</p>
    <li>There is a field named "sourcePopularity_BE" with visibility "public" of type "def" and default value null. This is an agent property. The block is tagged with the name "Source Popularity: BE".</li></p>
</p>
    <li>There is a field named "sourcePopularity_QoS" with visibility "public" of type "def" and default value null. This is an agent property. The block is tagged with the name "Source Popularity: QoS".</li></p>
</p>
    </p>
    </p>
        <li>There is a method named "initializeConnections" method has visibility     "public". This is the step behavior. The block is tagged with the name "initialize and update the possible Connections for the Agents".</li></p>
    </p>
    </p>
    <BLOCKQUOTE>The initializeConnections method is statically scheduled as follows:<BLOCKQUOTE></p>
        <li>start = 1d</li></p>
        <li>interval = 1d</li></p>
        <li>priority = 1.7976931348623157E308d</li></p>
        <li>shuffle = true</li></p>
    </BLOCKQUOTE></BLOCKQUOTE></p>
 <BLOCKQUOTE>The code for the "initializeConnections" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
         This is a task.</p>
        Context context = FindContext("TLabsQoSModell")</p>
        Network network = (Network) context.getProjection("SimulationNetwork")</p>
        Grid grid = (Grid) context.getProjection("Grid2D")</p>
        Query<SimulationAgent> allAgents = new OrQuery( (new PropertyEquals(context, "connected", true)) , (new PropertyEquals(context, "connected", false)) )</p>
        setPossibleConnections(new ArrayList(allAgents.query().iterator().toList()))</p>
</p>
         This is a loop.</p>
        for (int i = 0; i < possibleConnections.size(); i++) <BLOCKQUOTE></p>
</p>
             This is a task.</p>
            SimulationAgent tempAgent = (SimulationAgent) possibleConnections.get(i)</p>
            tempAgent.connected = false</p>
</p>
        </BLOCKQUOTE></p>
</p>
         End the method.</p>
        return</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
    </p>
    </p>
        <li>There is a method named "initializePConnections" method has visibility     "public". This is the step behavior. The block is tagged with the name "initialize and update the possible Connections for the Agents".</li></p>
    </p>
    </p>
    <BLOCKQUOTE>The initializePConnections method is statically scheduled as follows:<BLOCKQUOTE></p>
        <li>start = 3d</li></p>
        <li>interval = 1d</li></p>
        <li>shuffle = true</li></p>
    </BLOCKQUOTE></BLOCKQUOTE></p>
 <BLOCKQUOTE>The code for the "initializePConnections" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
         This is a task.</p>
        Context context = FindContext("TLabsQoSModell")</p>
        Network network = (Network) context.getProjection("SimulationNetwork")</p>
        Grid ggrid = (Grid) context.getProjection("Grid2D")</p>
        this.pConnections = []</p>
        this.pConnections = this.posConnections</p>
</p>
         This is an agent decision.</p>
        if (this.pConnections != null && this.peeringConnections != null && this.transitConnections != null) <BLOCKQUOTE></p>
</p>
</p>
             This is an agent decision.</p>
            if (providerMethod == "priceBased" || providerMethod == "priceBasedSelective" || providerMethod == "performanceBased") <BLOCKQUOTE></p>
</p>
</p>
                 This is an agent decision.</p>
                if (this.typeOfNetwork == "EC" || this.typeOfNetwork == "CP") <BLOCKQUOTE></p>
</p>
                     This is a task.</p>
                    Query<SimulationAgent> aQuery = new OrQuery( (new PropertyEquals(context, "typeOfNetwork", "EC")) , (new PropertyEquals(context, "typeOfNetwork", "CP")) )</p>
                    this.pConnections = this.pConnections - new ArrayList(aQuery.query().iterator().toList()) - this.transitConnections - this.peeringConnections</p>
</p>
                </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                     This is an agent decision.</p>
                    if (this.typeOfNetwork == "STP") <BLOCKQUOTE></p>
</p>
                         This is a task.</p>
                        Query<SimulationAgent> aQuery = new OrQuery( (new PropertyEquals(context, "typeOfNetwork", "EC")) , (new PropertyEquals(context, "typeOfNetwork", "CP")) )</p>
                        this.pConnections = this.pConnections - new ArrayList(aQuery.query().iterator().toList()) - this.transitConnections - this.peeringConnections - this.removedAgentsBecauseOfPeering</p>
</p>
                         This is an agent decision.</p>
                        if (this.typeOfNetwork == "STP" && this.providerMethod == "priceBasedSelective") <BLOCKQUOTE></p>
</p>
</p>
                             This is a loop.</p>
                            for (int i = 0; i < this.pConnections.size(); i++) <BLOCKQUOTE></p>
</p>
                                 This is a task.</p>
                                SimulationAgent tempAgent = (SimulationAgent) this.pConnections.get(i)</p>
</p>
                                 This is an agent decision.</p>
                                if (tempAgent.getTypeOfNetwork() == "LTP" ) <BLOCKQUOTE></p>
</p>
                                     This is a task.</p>
                                    ArrayList citiesIntersection = new ArrayList()</p>
                                    ArrayList biggerList = new ArrayList()</p>
                                    citiesIntersection = []</p>
                                    biggerList = []</p>
</p>
                                     This is an agent decision.</p>
                                    if (this.listOfPublicCities.size() >= tempAgent.listOfPublicCities.size()) <BLOCKQUOTE></p>
</p>
                                         This is a task.</p>
                                        biggerList = this.listOfPublicCities</p>
                                        first calculate the non intersection</p>
                                        citiesIntersection = biggerList - tempAgent.listOfPublicCities</p>
</p>
                                    </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
                                         This is a task.</p>
                                        biggerList = tempAgent.listOfPublicCities</p>
                                        first calculate the non intersection</p>
                                        citiesIntersection = biggerList - this.listOfPublicCities</p>
</p>
                                    </BLOCKQUOTE></p>
                                     This is a task.</p>
                                    citiesIntersection = biggerList - citiesIntersection</p>
</p>
                                     This is an agent decision.</p>
                                    if (citiesIntersection.size() >= GetParameter("competitiveLevel")) <BLOCKQUOTE></p>
</p>
                                         This is a task.</p>
                                        this.pConnections = this.pConnections - tempAgent</p>
                                        i = i-1</p>
</p>
                                    </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                                    </BLOCKQUOTE></p>
</p>
                                </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                                </BLOCKQUOTE></p>
</p>
                                 This is an agent decision.</p>
                                if (this.pConnections.size() > 0 && this != null && pConnections.contains(this) == true) <BLOCKQUOTE></p>
</p>
                                     This is a task.</p>
                                    setPConnections(pConnections - this)</p>
</p>
                                </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                                </BLOCKQUOTE></p>
</p>
                            </BLOCKQUOTE></p>
</p>
</p>
                        </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                        </BLOCKQUOTE></p>
</p>
                    </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
                         This is a task.</p>
                        Query<SimulationAgent> aQuery = new PropertyEquals(context, "typeOfNetwork", "STP")</p>
                        Query <SimulationAgent> bQuery = new OrQuery( (new PropertyEquals(context, "typeOfNetwork", "EC")) , (new PropertyEquals(context, "typeOfNetwork", "CP")) )</p>
                        this.pConnections = this.pConnections - new ArrayList(aQuery.query().iterator().toList()) - new ArrayList(bQuery.query().iterator().toList()) - this.transitConnections - this.peeringConnections - this.removedAgentsBecauseOfPeering</p>
</p>
                    </BLOCKQUOTE></p>
</p>
                </BLOCKQUOTE></p>
</p>
            </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                 This is an agent decision.</p>
                if (providerMethod == "directAccessibility") <BLOCKQUOTE></p>
</p>
                     This is a task.</p>
                    this.pConnections = this.pConnections - this.qosConnections - this.agentsWithNoTrafficExchange</p>
</p>
                </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                     This is an agent decision.</p>
                    if (providerMethod == "scope" || providerMethod == "qosPriceBased") <BLOCKQUOTE></p>
</p>
                         This is a task.</p>
                        this.pConnections = this.pConnections - this.qosConnections</p>
</p>
                    </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                    </BLOCKQUOTE></p>
</p>
                </BLOCKQUOTE></p>
</p>
            </BLOCKQUOTE></p>
</p>
        </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
        </BLOCKQUOTE></p>
         End the method.</p>
        return</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
    </p>
    </p>
        <li>There is a method named "initializeTransitConnections" method has visibility     "public". This is the step behavior. The block is tagged with the name "note existing Interconnections and update the possible Connections".</li></p>
    </p>
    </p>
    <BLOCKQUOTE>The initializeTransitConnections method is statically scheduled as follows:<BLOCKQUOTE></p>
        <li>start = 1d</li></p>
        <li>shuffle = true</li></p>
    </BLOCKQUOTE></BLOCKQUOTE></p>
 <BLOCKQUOTE>The code for the "initializeTransitConnections" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
         This is a task.</p>
        Context context = FindContext("TLabsQoSModell"); qosConnections = []; peeringConnections = []; transitConnections = []</p>
        Network network = (Network) context.getProjection("SimulationNetwork")</p>
        Query<SimulationAgent> netQuery = new NetworkSuccessor(context,this)       </p>
        ArrayList temp = new ArrayList()</p>
        temp = netQuery.query().iterator().toList()</p>
</p>
         This is an agent decision.</p>
        if (temp == []) <BLOCKQUOTE></p>
</p>
             This is a task.</p>
            setTransitConnections([])</p>
</p>
        </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
             This is a task.</p>
            setTransitConnections(temp)</p>
</p>
        </BLOCKQUOTE></p>
         End the method.</p>
        return</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
    </p>
    </p>
        <li>There is a method named "setBackbones" method has visibility     "public". This is the step behavior. The block is tagged with the name "initialize: Network is Backbone".</li></p>
    </p>
    </p>
    <BLOCKQUOTE>The setBackbones method is statically scheduled as follows:<BLOCKQUOTE></p>
        <li>start = 1d</li></p>
        <li>shuffle = true</li></p>
    </BLOCKQUOTE></BLOCKQUOTE></p>
 <BLOCKQUOTE>The code for the "setBackbones" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
         Get Agents to set backbones</p>
        Context context = FindContext("TLabsQoSModell"); Network network = (Network) context.getProjection("SimulationNetwork"); Grid grid = (Grid) context.getProjection("Grid2D")</p>
        Query<SimulationAgent> netQuery = new AndQuery((new PropertyGreaterThan(context, "publicCount", 10)),(new PropertyGreaterThan(context, "privateCount", 10)))</p>
        Query<SimulationAgent> netQuery2 = new PropertyEquals(context, "agentIsBackbone", true)</p>
        ArrayList possibleBackbones = []; possibleBackbones = new ArrayList(netQuery.query().iterator().toList()); listOfBackbones = new ArrayList(netQuery2.query().iterator().toList())</p>
        int bbpercentage = 10; double backbonesize = (bbpercentage possibleBackbones.size()) / 100</p>
</p>
         This is an agent decision.</p>
        if (backbonesize < 1 ) <BLOCKQUOTE></p>
</p>
</p>
             This is an agent decision.</p>
            if (backbonesize > 0) <BLOCKQUOTE></p>
</p>
                 This is a task.</p>
                backbonesize = 1</p>
</p>
            </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
            </BLOCKQUOTE></p>
</p>
             This is an agent decision.</p>
            if (possibleBackbones.size() > 0) <BLOCKQUOTE></p>
</p>
</p>
                 This is a loop.</p>
                for (int b = 0; b < backbonesize; b++) <BLOCKQUOTE></p>
</p>
                     This is a task.</p>
                    SimulationAgent tempAgent = (SimulationAgent) possibleBackbones.get(b)</p>
                    tempAgent.agentIsBackbone = true</p>
</p>
                     This is an agent decision.</p>
                    if (this.listOfBackbones.contains(tempAgent) == false) <BLOCKQUOTE></p>
</p>
                         This is a task.</p>
                        this.listOfBackbones = this.listOfBackbones + tempAgent</p>
</p>
                    </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                    </BLOCKQUOTE></p>
</p>
                </BLOCKQUOTE></p>
</p>
</p>
            </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
            </BLOCKQUOTE></p>
</p>
        </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
        </BLOCKQUOTE></p>
         End the method.</p>
        return</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
    </p>
    </p>
        <li>There is a method named "initPopularity1" method has visibility     "public". This is the step behavior. The block is tagged with the name "initialize: initPopularity".</li></p>
    </p>
    </p>
    <BLOCKQUOTE>The initPopularity1 method is statically scheduled as follows:<BLOCKQUOTE></p>
        <li>start = 2d</li></p>
        <li>shuffle = true</li></p>
    </BLOCKQUOTE></BLOCKQUOTE></p>
 <BLOCKQUOTE>The code for the "initPopularity1" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
         End the method.</p>
        return</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
    </p>
    </p>
        <li>There is a method named "initTypeOfNetwork" method has visibility     "public". This behavior initializes the type of Network for the given Agents. To set this property the behavior reads the networkType-property The block is tagged with the name "initialize: typeOfNetwork".</li></p>
    </p>
    </p>
    <BLOCKQUOTE>The initTypeOfNetwork method is statically scheduled as follows:<BLOCKQUOTE></p>
        <li>start = 1d</li></p>
        <li>shuffle = true</li></p>
    </BLOCKQUOTE></BLOCKQUOTE></p>
 <BLOCKQUOTE>The code for the "initTypeOfNetwork" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
         This is a task.</p>
        def type = this.getNetworkType()</p>
        def ratio = this.getTrafficRatio()</p>
        def scope = this.getGeographicScope()</p>
         This is a task.</p>
        type.eachLine()<BLOCKQUOTE> elem -></p>
            if(elem =~ /Content/)<BLOCKQUOTE></p>
                ratio.eachLine()<BLOCKQUOTE></p>
                 if(it =~ /Balanced/)<BLOCKQUOTE></p>
                this.setTypeOfNetwork("EC")</p>
                 </BLOCKQUOTE></p>
                 if(it =~ /Inbound/)<BLOCKQUOTE></p>
                 </p>
           this.setTypeOfNetwork("EC")</p>
                 </BLOCKQUOTE>else<BLOCKQUOTE></p>
                this.setTypeOfNetwork("CP")</p>
                 </BLOCKQUOTE></p>
                </BLOCKQUOTE></p>
               </BLOCKQUOTE></p>
               if(elem =~ /Educational/)<BLOCKQUOTE></p>
              this.setTypeOfNetwork("EC")</p>
               </BLOCKQUOTE></p>
               if(elem =~ /NSP/ || elem =~ /ISP/)<BLOCKQUOTE></p>
                scope.eachLine()<BLOCKQUOTE></p>
                 if (it =~ /Global/)<BLOCKQUOTE></p>
                this.setTypeOfNetwork("LTP")</p>
                 </BLOCKQUOTE>else<BLOCKQUOTE></p>
          if((publicCities+privateCities) >  25)<BLOCKQUOTE></p>
                 this.setTypeOfNetwork("LTP")</p>
          </BLOCKQUOTE>else<BLOCKQUOTE></p>
                this.setTypeOfNetwork("STP")</p>
          </BLOCKQUOTE>   </p>
                 </BLOCKQUOTE></p>
                </BLOCKQUOTE></p>
               </BLOCKQUOTE>         </p>
        </BLOCKQUOTE></p>
         End the method.</p>
        return</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
    </p>
    </p>
        <li>There is a method named "initTPM" method has visibility     "public" has return type "def". This is the step behavior. The block is tagged with the name "initialize: Transit Price Multiplier (based on specific Distribution (normal))".</li></p>
    </p>
    </p>
    <BLOCKQUOTE>The initTPM method is statically scheduled as follows:<BLOCKQUOTE></p>
        <li>start = 2d</li></p>
        <li>shuffle = true</li></p>
    </BLOCKQUOTE></BLOCKQUOTE></p>
 <BLOCKQUOTE>The code for the "initTPM" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Define the return value variable.</p>
        def returnValue</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
</p>
         This is an agent decision.</p>
        if (getTypeOfNetwork() == "STP") <BLOCKQUOTE></p>
</p>
             This is a task.</p>
            RandomHelper.createNormal(85, 22.5)</p>
            setTransitPriceMultiplier(RandomHelper.normal.nextDouble())</p>
</p>
        </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
             This is an agent decision.</p>
            if (getTypeOfNetwork() == "LTP") <BLOCKQUOTE></p>
</p>
                 This is a task.</p>
                RandomHelper.createNormal(115, 17.5)</p>
                setTransitPriceMultiplier(RandomHelper.normal.nextDouble())</p>
</p>
            </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
            </BLOCKQUOTE></p>
</p>
        </BLOCKQUOTE></p>
         Return the results.</p>
        return returnValue</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
    </p>
    </p>
        <li>There is a method named "initializePeeringSelectionMethod" method has visibility     "public" has return type "def". This is the step behavior. The block is tagged with the name "initialize: Peering Selection Method".</li></p>
    </p>
    </p>
    <BLOCKQUOTE>The initializePeeringSelectionMethod method is statically scheduled as follows:<BLOCKQUOTE></p>
        <li>start = 2d</li></p>
        <li>shuffle = true</li></p>
    </BLOCKQUOTE></BLOCKQUOTE></p>
 <BLOCKQUOTE>The code for the "initializePeeringSelectionMethod" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Define the return value variable.</p>
        def returnValue</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
</p>
         This is an agent decision.</p>
        if (typeOfNetwork == "CP") <BLOCKQUOTE></p>
</p>
             This is a task.</p>
            int number = RandomDraw(1, 3)</p>
</p>
             This is an agent decision.</p>
            if (number == 1) <BLOCKQUOTE></p>
</p>
                 This is a task.</p>
                setPeeringMethod("necessity")</p>
</p>
            </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
                 This is a task.</p>
                setPeeringMethod("trafficRatios")</p>
</p>
            </BLOCKQUOTE></p>
</p>
        </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
             This is an agent decision.</p>
            if (typeOfNetwork == "STP" || typeOfNetwork == "LTP") <BLOCKQUOTE></p>
</p>
                 This is a task.</p>
                int number = RandomDraw(1, 3)</p>
</p>
                 This is an agent decision.</p>
                if (number == 1) <BLOCKQUOTE></p>
</p>
                     This is a task.</p>
                    setPeeringMethod("necessity")</p>
</p>
                </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                     This is an agent decision.</p>
                    if (number == 2) <BLOCKQUOTE></p>
</p>
                         This is a task.</p>
                        setPeeringMethod("trafficRatios")</p>
</p>
                    </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                         This is an agent decision.</p>
                        if (number == 3) <BLOCKQUOTE></p>
</p>
                             This is a task.</p>
                            setPeeringMethod("costBenefitAnalysis")</p>
</p>
                        </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                        </BLOCKQUOTE></p>
</p>
                    </BLOCKQUOTE></p>
</p>
                </BLOCKQUOTE></p>
</p>
            </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
            </BLOCKQUOTE></p>
</p>
        </BLOCKQUOTE></p>
         Return the results.</p>
        return returnValue</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
    </p>
    </p>
        <li>There is a method named "initializeProviderSelectionMethod" method has visibility     "public" has return type "def". This is the step behavior. The block is tagged with the name "initialize: Provider Selection Method".</li></p>
    </p>
    </p>
    <BLOCKQUOTE>The initializeProviderSelectionMethod method is statically scheduled as follows:<BLOCKQUOTE></p>
        <li>start = 2d</li></p>
        <li>shuffle = true</li></p>
    </BLOCKQUOTE></BLOCKQUOTE></p>
 <BLOCKQUOTE>The code for the "initializeProviderSelectionMethod" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Define the return value variable.</p>
        def returnValue</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
</p>
         This is an agent decision.</p>
        if (typeOfNetwork == "EC") <BLOCKQUOTE></p>
</p>
             This is a task.</p>
            int number = RandomDraw(1, 5)</p>
</p>
             This is an agent decision.</p>
            if (number == 1) <BLOCKQUOTE></p>
</p>
                 This is a task.</p>
                setProviderMethod("priceBased")</p>
</p>
            </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                 This is an agent decision.</p>
                if (number == 2) <BLOCKQUOTE></p>
</p>
                     This is a task.</p>
                    setProviderMethod("performanceBased")</p>
</p>
                </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                     This is an agent decision.</p>
                    if (number == 3) <BLOCKQUOTE></p>
</p>
                         This is a task.</p>
                        setProviderMethod("directAccessibility")</p>
</p>
                    </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
                         This is a task.</p>
                        setProviderMethod("scope")</p>
</p>
                    </BLOCKQUOTE></p>
</p>
                </BLOCKQUOTE></p>
</p>
            </BLOCKQUOTE></p>
</p>
        </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
             This is an agent decision.</p>
            if (typeOfNetwork == "CP") <BLOCKQUOTE></p>
</p>
                 This is a task.</p>
                int number = RandomDraw(1, 5)</p>
</p>
                 This is an agent decision.</p>
                if (number == 1) <BLOCKQUOTE></p>
</p>
                     This is a task.</p>
                    setProviderMethod("priceBased")</p>
</p>
                </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                     This is an agent decision.</p>
                    if (number == 2) <BLOCKQUOTE></p>
</p>
                         This is a task.</p>
                        setProviderMethod("performanceBased")</p>
</p>
                    </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                         This is an agent decision.</p>
                        if (number == 3) <BLOCKQUOTE></p>
</p>
                             This is a task.</p>
                            setProviderMethod("directAccessibility")</p>
</p>
                        </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
                             This is a task.</p>
                            setProviderMethod("scope")</p>
</p>
                        </BLOCKQUOTE></p>
</p>
                    </BLOCKQUOTE></p>
</p>
                </BLOCKQUOTE></p>
</p>
            </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                 This is an agent decision.</p>
                if (typeOfNetwork == "STP" || typeOfNetwork == "LTP") <BLOCKQUOTE></p>
</p>
                     This is a task.</p>
                    int number = RandomDraw(1, 5)</p>
</p>
                     This is an agent decision.</p>
                    if (number == 1) <BLOCKQUOTE></p>
</p>
                         This is a task.</p>
                        setProviderMethod("priceBasedSelective")</p>
</p>
                    </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                         This is an agent decision.</p>
                        if (number == 2) <BLOCKQUOTE></p>
</p>
                             This is a task.</p>
                            setProviderMethod("priceBased")</p>
</p>
                        </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                             This is an agent decision.</p>
                            if (number == 3) <BLOCKQUOTE></p>
</p>
                                 This is a task.</p>
                                setProviderMethod("directAccessibility")</p>
</p>
                            </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
                                 This is a task.</p>
                                setProviderMethod("scope")</p>
</p>
                            </BLOCKQUOTE></p>
</p>
                        </BLOCKQUOTE></p>
</p>
                    </BLOCKQUOTE></p>
</p>
                </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                </BLOCKQUOTE></p>
</p>
            </BLOCKQUOTE></p>
</p>
        </BLOCKQUOTE></p>
         Return the results.</p>
        return returnValue</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
    </p>
    </p>
        <li>There is a method named "initCities" method has visibility     "public" has return type "def". This is the step behavior. The block is tagged with the name "initialize: cities of the Agent".</li></p>
    </p>
    </p>
    <BLOCKQUOTE>The initCities method is statically scheduled as follows:<BLOCKQUOTE></p>
        <li>start = 1d</li></p>
        <li>priority = -1.7976931348623157E308d</li></p>
        <li>shuffle = true</li></p>
    </BLOCKQUOTE></BLOCKQUOTE></p>
 <BLOCKQUOTE>The code for the "initCities" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Define the return value variable.</p>
        def returnValue</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
         This is a task.</p>
        setListOfPublicCities([])</p>
        setPosConnections([])</p>
        setRemovedAgentsBecauseOfPeering([])</p>
        setAgentsWithNoTrafficExchange([])</p>
        File file = new File("C:/Dokumente und Einstellungen/Gast/Desktop/repast_cities.xml")</p>
        def rootNode = new XmlParser().parse(file)</p>
        this.posConnections = this.possibleConnections - this</p>
        rootNode.agentID.each()<BLOCKQUOTE></p>
           if(it.value() =~ this.toString())<BLOCKQUOTE></p>
            listOfPublicCities.add(it.city[0].value().toString())</p>
        </BLOCKQUOTE></p>
        </BLOCKQUOTE></p>
         notice: To look up if the list contains a city the city must be a String like "[.. ]"</p>
         Return the results.</p>
        return returnValue</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
    </p>
    </p>
        <li>There is a method named "matrixPos" method has visibility     "public" has return type "def" and parameters [String name].   Get Position on Column; To get the Position on Row you need to add a "-1" , because, ColumnCount = RowCount+1 => RowCount = ColumnCount-1; Different Kinds of counting The block is tagged with the name "compute the Position of the Agent in the sinkSourceMatrix".</li></p>
    </p>
    </p>
 <BLOCKQUOTE>The code for the "matrixPos" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Define the return value variable.</p>
        def returnValue</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
         This is a task.</p>
        def position</p>
        Context context = FindContext("TLabsQoSModell")</p>
        Network network = (Network) context.getProjection("SimulationNetwork")</p>
        ConnectivityMatrixTableModel cnMatrix = new ConnectivityMatrixTableModel(network.getGraph())</p>
</p>
         Define a auxiliary variable to know the real Column for an Agent</p>
        for (int k=1;k<cnMatrix.getColumnCount();k++) <BLOCKQUOTE></p>
</p>
</p>
             This is an agent decision.</p>
            if (cnMatrix.getColumnName(k).equals(name)) <BLOCKQUOTE></p>
</p>
                 This is a task.</p>
                position = k</p>
</p>
            </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
            </BLOCKQUOTE></p>
</p>
        </BLOCKQUOTE></p>
</p>
          Need this transformation pos-1, see explanation on comment up to this.</p>
        return position - 1</p>
         Return the results.</p>
        return returnValue</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
    </p>
    </p>
        <li>There is a method named "initSimilarityIndex" method has visibility     "public" has return type "def". This is the step behavior. The block is tagged with the name "initialize: Similarity Index".</li></p>
    </p>
    </p>
    <BLOCKQUOTE>The initSimilarityIndex method is statically scheduled as follows:<BLOCKQUOTE></p>
        <li>start = 1d</li></p>
        <li>shuffle = true</li></p>
    </BLOCKQUOTE></BLOCKQUOTE></p>
 <BLOCKQUOTE>The code for the "initSimilarityIndex" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Define the return value variable.</p>
        def returnValue</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
         This is a task.</p>
        setSimilarityMap([:])</p>
        File file = new File("C:/Dokumente und Einstellungen/Gast/Desktop/repast_similarity.xml")</p>
        def rootNode = new XmlParser().parse(file)</p>
        rootNode.providerA.each<BLOCKQUOTE></p>
        if(it.'@value' =~ this.toString())<BLOCKQUOTE></p>
            def key, a, b, c, ji, si, cl</p>
         key = it.providerB[0].'@value'</p>
            a = (it.A[0].'@value').toInteger()</p>
            b = (it.B[0].'@value').toInteger()</p>
            c = (it.C[0].'@value').toInteger()</p>
            ji = (it.JI[0].'@value').toDouble()</p>
            si = (it.SI[0].'@value').toDouble()</p>
        cl = c / a</p>
            IndexPairs ixp = new IndexPairs(a,b,c,ji,si,cl)</p>
            similarityMap.put(key,ixp)</p>
           </BLOCKQUOTE></p>
        </BLOCKQUOTE></p>
        println "Agent: " + this +  " Liste SIMILARITY Index: " + similarityMap</p>
         Return the results.</p>
        return returnValue</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
    </p>
    </p>
        <li>There is a method named "similarityCheck" method has visibility     "public" has return type "def". This is the step behavior. The block is tagged with the name "initialize: possible Connections depending on Agents`s similarity".</li></p>
    </p>
    </p>
    <BLOCKQUOTE>The similarityCheck method is statically scheduled as follows:<BLOCKQUOTE></p>
        <li>start = 2d</li></p>
        <li>shuffle = true</li></p>
    </BLOCKQUOTE></BLOCKQUOTE></p>
 <BLOCKQUOTE>The code for the "similarityCheck" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Define the return value variable.</p>
        def returnValue</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
</p>
         This is an agent decision.</p>
        if (this.similarityMap != null && this.possibleConnections != null && this.possibleConnections.size() > 0) <BLOCKQUOTE></p>
</p>
             This is a task.</p>
            def tempValue = 0</p>
            def key = ""</p>
            def posConnections = []</p>
            this.posConnections = this.possibleConnections - this</p>
</p>
             This is a loop.</p>
            for (int i = 0; i < this.possibleConnections.size(); i++) <BLOCKQUOTE></p>
</p>
                 This is a task.</p>
                SimulationAgent tempAgent = (SimulationAgent) this.possibleConnections.get(i)</p>
                key = tempAgent.toString()</p>
</p>
                 This is an agent decision.</p>
                if (this.similarityMap.getAt(key) != null) <BLOCKQUOTE></p>
</p>
                     This is a task.</p>
                    tempValue = this.similarityMap.getAt(key).getSI()</p>
</p>
                </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
                     This is a task.</p>
                    this.posConnections = this.posConnections - tempAgent</p>
</p>
                </BLOCKQUOTE></p>
</p>
                 This is an agent decision.</p>
                if (tempValue > 0) <BLOCKQUOTE></p>
</p>
</p>
                     This is an agent decision.</p>
                    if (tempValue > GetParameter("competitiveLevel")) <BLOCKQUOTE></p>
</p>
                         This is a task.</p>
                        this.posConnections = this.posConnections - tempAgent</p>
</p>
                    </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                    </BLOCKQUOTE></p>
</p>
                </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                </BLOCKQUOTE></p>
</p>
            </BLOCKQUOTE></p>
</p>
</p>
        </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
        </BLOCKQUOTE></p>
         Return the results.</p>
        return returnValue</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
    </p>
    </p>
        <li>There is a method named "AgentsWithSharedCities" method has visibility     "public" has return type "def". This is the step behavior. The block is tagged with the name "initialize: possible Connections depending on the Agents`s cities (>1 shared cities)".</li></p>
    </p>
    </p>
    <BLOCKQUOTE>The AgentsWithSharedCities method is statically scheduled as follows:<BLOCKQUOTE></p>
        <li>start = 2d</li></p>
        <li>shuffle = true</li></p>
    </BLOCKQUOTE></BLOCKQUOTE></p>
 <BLOCKQUOTE>The code for the "AgentsWithSharedCities" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Define the return value variable.</p>
        def returnValue</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
         Return the results.</p>
        return returnValue</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
    </p>
    </p>
        <li>There is a method named "initTraffic" method has visibility     "public". This is the step behavior. The block is tagged with the name "compute: different TrafficValues".</li></p>
    </p>
    </p>
    <BLOCKQUOTE>The initTraffic method is statically scheduled as follows:<BLOCKQUOTE></p>
        <li>start = 2d</li></p>
        <li>priority = 0.85d</li></p>
        <li>shuffle = true</li></p>
    </BLOCKQUOTE></BLOCKQUOTE></p>
 <BLOCKQUOTE>The code for the "initTraffic" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
         Define parameter</p>
        def trafficRatio = this.getTrafficRatio()</p>
        double i_rate = 0</p>
        double c_rate = 0</p>
        double ratio = 0 ratio = (I + C) / trafficLevel</p>
        def temptraffic = ""</p>
</p>
         This is an agent decision.</p>
        if (this.trafficRatio == "Heavy Outbound") <BLOCKQUOTE></p>
</p>
             This is a task.</p>
            i_rate = 0</p>
            c_rate = 1</p>
</p>
        </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
             This is an agent decision.</p>
            if (this.trafficRatio == "Mostly Outbound") <BLOCKQUOTE></p>
</p>
                 This is a task.</p>
                i_rate = 0.2</p>
                c_rate = 0.8</p>
</p>
            </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                 This is an agent decision.</p>
                if (this.trafficRatio == "Balanced") <BLOCKQUOTE></p>
</p>
                     This is a task.</p>
                    i_rate = 0.5</p>
                    c_rate = 0.5</p>
</p>
                </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                     This is an agent decision.</p>
                    if (this.trafficRatio == "Mostly Inbound") <BLOCKQUOTE></p>
</p>
                         This is a task.</p>
                        i_rate = 0.8</p>
                        c_rate = 0.2</p>
</p>
                    </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                         This is an agent decision.</p>
                        if (this.trafficRatio == "Heavy Inbound") <BLOCKQUOTE></p>
</p>
                             This is a task.</p>
                            i_rate = 1</p>
                            c_rate = 0</p>
</p>
                        </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
                             This is a task.</p>
                            System.out.println("No TrafficRatio defined !")</p>
</p>
                        </BLOCKQUOTE></p>
</p>
                    </BLOCKQUOTE></p>
</p>
                </BLOCKQUOTE></p>
</p>
            </BLOCKQUOTE></p>
</p>
        </BLOCKQUOTE></p>
         In this Task the String from SQL-DB is read out from param: trafficLevel. String is read out & this defines the i_traffic param</p>
        int trafficDevelopmentRound = 0</p>
         start with initial QoS demand</p>
        trafficDevelopmentRound = quaterCheck</p>
        println "TrafficDevelopmentRound: " +trafficDevelopmentRound</p>
        qosDemand = GetParameter("initQoSDemand")/100 + (GetParameter("boundaryQoSTraffic")/100 - GetParameter("initQoSDemand")/100) (1 - exp(Math.pow((-1) trafficDevelopmentRound, GetParameter("trafficProcess"))))</p>
        println "QOS DEMAND: " +qosDemand</p>
        if(this.getTypeOfNetwork() == "EC")<BLOCKQUOTE></p>
        ratio = 1</p>
        </BLOCKQUOTE></p>
        if(this.getTypeOfNetwork() == "STP")<BLOCKQUOTE></p>
        ratio = 0.5  assumption: Transit(STP) = I + C</p>
         </BLOCKQUOTE></p>
        if(this.getTypeOfNetwork() == "LTP")<BLOCKQUOTE></p>
        ratio = 0.25  assumption: Transit(LTP) = 3(I + C)</p>
        </BLOCKQUOTE></p>
        if(this.getTypeOfNetwork() == "CP")<BLOCKQUOTE></p>
        ratio = 1</p>
        </BLOCKQUOTE></p>
        if (trafficDevelopmentRound == 0) <BLOCKQUOTE></p>
        this.overallTraffic = this.overallTraffic</p>
        </BLOCKQUOTE> else <BLOCKQUOTE></p>
        this.overallTraffic = this.overallTraffic 1.5</p>
        </BLOCKQUOTE></p>
        this.overallTraffic_BE = this.overallTraffic (1-qosDemand)</p>
        this.overallTraffic_QoS = this.overallTraffic qosDemand</p>
        this.i_traffic = this.overallTraffic i_rate ratio</p>
        this.i_traffic_BE = this.overallTraffic_BE i_rate ratio </p>
        this.i_traffic_QoS = this.overallTraffic_QoS i_rate ratio</p>
        this.c_traffic = this.overallTraffic c_rate ratio</p>
        this.c_traffic_BE = this.overallTraffic_BE c_rate ratio</p>
        this.c_traffic_QoS = this.overallTraffic_QoS c_rate ratio</p>
        this.t_traffic = (this.overallTraffic - this.i_traffic - this.c_traffic).plus(" Gbps")</p>
        this.t_traffic_BE = this.overallTraffic_BE - this.i_traffic_BE - this.c_traffic_BE</p>
        this.t_traffic_QoS = this.overallTraffic_QoS - this.i_traffic_QoS - this.c_traffic_QoS</p>
        this.i_traffic = this.i_traffic.plus(" Gbps")</p>
        this.c_traffic = this.c_traffic.plus(" Gbps")</p>
         End the method.</p>
        return</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
    </p>
    </p>
        <li>There is a method named "initOverallTraffic" method has visibility     "public". This is the step behavior. The block is tagged with the name "initialize: overallTraffic".</li></p>
    </p>
    </p>
    <BLOCKQUOTE>The initOverallTraffic method is statically scheduled as follows:<BLOCKQUOTE></p>
        <li>start = 2d</li></p>
        <li>priority = 1.05d</li></p>
        <li>shuffle = true</li></p>
    </BLOCKQUOTE></BLOCKQUOTE></p>
 <BLOCKQUOTE>The code for the "initOverallTraffic" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
         Define parameter</p>
        def trafficLevel = this.getTrafficLevel()</p>
        def temptrafficlevelmax = 0</p>
        def temptrafficlevelmin = 0</p>
        def temptraffic = ""</p>
        trafficLevel.eachLine()<BLOCKQUOTE>elem -></p>
          if(elem =~ /Mbps/)<BLOCKQUOTE></p>
           temptraffic = trafficLevel.minus("Mbps")</p>
           temptraffic.eachLine()<BLOCKQUOTE></p>
                     if(it =~ /-/)<BLOCKQUOTE></p>
                      String[] templist = it.split("-")</p>
             temptrafficlevelmin = templist[0].toInteger() </p>
                      temptrafficlevelmax = templist[1].toInteger() </p>
            data unit is Gbps</p>
            this.overallTraffic = (temptrafficlevelmin + temptrafficlevelmax) / (2 1000)</p>
           </BLOCKQUOTE> else<BLOCKQUOTE></p>
                      temptrafficlevelmax = ((String)it).toInteger() </p>
            this.overallTraffic = temptrafficlevelmax / 1000</p>
           </BLOCKQUOTE></p>
            </BLOCKQUOTE></p>
          </BLOCKQUOTE></p>
          if(elem =~ /Gbps/ && elem.contains("+") == false)<BLOCKQUOTE></p>
           temptraffic = trafficLevel.minus("Gbps")</p>
           temptraffic.eachLine()<BLOCKQUOTE></p>
           if(it =~ /-/)<BLOCKQUOTE></p>
            String[] templist = it.split("-")</p>
            temptrafficlevelmin = templist[0].toInteger() </p>
                      temptrafficlevelmax = templist[1].toInteger() </p>
            this.overallTraffic = (temptrafficlevelmin + temptrafficlevelmax) / 2</p>
           </BLOCKQUOTE> else<BLOCKQUOTE></p>
            temptrafficlevelmax = ((String)it).toInteger() </p>
            this.overallTraffic = temptrafficlevelmax</p>
           </BLOCKQUOTE></p>
            </BLOCKQUOTE></p>
          </BLOCKQUOTE></p>
          if(elem.contains("+ Gbps") == true)<BLOCKQUOTE></p>
           temptraffic = trafficLevel.minus("+ Gbps")</p>
           temptrafficlevelmax =  ((String)temptraffic).toInteger()</p>
           this.overallTraffic = 2 temptrafficlevelmax</p>
          </BLOCKQUOTE></p>
          if(elem =~ /Tbps/ && elem.contains("Tbps+") == false)<BLOCKQUOTE></p>
           temptraffic = trafficLevel.minus("Tbps")</p>
           temptraffic.eachLine()<BLOCKQUOTE></p>
           if(it =~ /-/)<BLOCKQUOTE></p>
            String[] templist = it.split("-")</p>
           temptrafficlevelmin = templist[0].toInteger() </p>
           temptrafficlevelmax = templist[1].toInteger()</p>
           this.overallTraffic = (temptrafficlevelmin + temptrafficlevelmax) 1000 / 2</p>
                     </BLOCKQUOTE> else<BLOCKQUOTE></p>
            temptrafficlevelmax = ((String)it).toInteger()</p>
            this.overallTraffic = temptrafficlevelmax 1000</p>
           </BLOCKQUOTE></p>
            </BLOCKQUOTE></p>
          </BLOCKQUOTE></p>
          if(elem.contains("Tbps+") == true)<BLOCKQUOTE></p>
           temptraffic = trafficLevel.minus("Tbps+")</p>
           temptrafficlevelmax =  ((String)temptraffic).toInteger()</p>
           this.overallTraffic =  2 temptrafficlevelmax 1000</p>
          </BLOCKQUOTE></p>
          if(elem =~ /Not Disclosed/)<BLOCKQUOTE></p>
           this.overallTraffic = 0</p>
          </BLOCKQUOTE></p>
        </BLOCKQUOTE></p>
         End the method.</p>
        return</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
    </p>
    </p>
        <li>There is a method named "initPopularity" method has visibility     "public". This is the step behavior. The block is tagged with the name "initialize: initPopularity".</li></p>
    </p>
    </p>
    <BLOCKQUOTE>The initPopularity method is statically scheduled as follows:<BLOCKQUOTE></p>
        <li>start = 3d</li></p>
        <li>priority = -1.05d</li></p>
        <li>shuffle = true</li></p>
    </BLOCKQUOTE></BLOCKQUOTE></p>
 <BLOCKQUOTE>The code for the "initPopularity" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
         This is a task.</p>
        println "SOURCE POPULARITY START !"</p>
</p>
         This is an agent decision.</p>
        if (this.similarityMap != null && this.pConnections != null && this.pConnections.size() > 0) <BLOCKQUOTE></p>
</p>
             This is a task.</p>
            def tempValue = 0</p>
            def key = ""</p>
            setSourcePopularity_BE([:])</p>
            setSourcePopularity_QoS([:])</p>
</p>
             This is a loop.</p>
            for (int i = 0; i < this.pConnections.size(); i++) <BLOCKQUOTE></p>
</p>
                 This is a task.</p>
                SimulationAgent tempAgent = (SimulationAgent) this.pConnections.get(i)</p>
                println "This & TempAgent: " +this + " ---- " +tempAgent</p>
                key = tempAgent.toString()</p>
</p>
                 This is an agent decision.</p>
                if (this.similarityMap.getAt(key) != null) <BLOCKQUOTE></p>
</p>
                     This is a task.</p>
                    tempValue = this.similarityMap.getAt(key).getSI()</p>
                    println "SI TempAgent: " +tempValue</p>
</p>
                     This is an agent decision.</p>
                    if (tempValue > 0 && tempAgent.getC_traffic() > 0) <BLOCKQUOTE></p>
</p>
                         This is a task.</p>
                        println "ALLRIGHT !!!"</p>
                        this.sourcePopularity_BE.put(tempAgent, (tempAgent.getC_traffic_BE() tempValue))</p>
                        this.sourcePopularity_QoS.put(tempAgent, (tempAgent.getC_traffic_QoS() tempValue))</p>
</p>
                    </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
                         This is a task.</p>
                        println "SI = 0 !"</p>
</p>
                    </BLOCKQUOTE></p>
</p>
                </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
                </BLOCKQUOTE></p>
</p>
            </BLOCKQUOTE></p>
</p>
             This is a task.</p>
            println "SP BE: " +this.sourcePopularity_BE</p>
            println "SP QoS: " +this.sourcePopularity_QoS</p>
</p>
        </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
</p>
        </BLOCKQUOTE></p>
         End the method.</p>
        return</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
</p>
</BLOCKQUOTE></p>
</p>
</BODY></HTML>